principal type - definizione. Che cos'è principal type
Diclib.com
Dizionario ChatGPT
Inserisci una parola o una frase in qualsiasi lingua 👆
Lingua:

Traduzione e analisi delle parole tramite l'intelligenza artificiale ChatGPT

In questa pagina puoi ottenere un'analisi dettagliata di una parola o frase, prodotta utilizzando la migliore tecnologia di intelligenza artificiale fino ad oggi:

  • come viene usata la parola
  • frequenza di utilizzo
  • è usato più spesso nel discorso orale o scritto
  • opzioni di traduzione delle parole
  • esempi di utilizzo (varie frasi con traduzione)
  • etimologia

Cosa (chi) è principal type - definizione

Principle type; Principal typing

principal type         
The most general type of an expression. For example, the following are all valid types for the lambda abstraction ( x . x): Int -> Int Bool -> Bool (a->b) -> (a->b) but any valid type will be an instance of the principal type: a -> a. An instance is derived by substituting the same type expression for all occurences of some type variable. The principal type of an expression can be computed from those of its subexpressions by Robinson's unification algorithm. (1994-12-16)
Principal type         
In type theory, a type system is said to have the principal type property if, given a term and an environment, there exists a principal type for this term in this environment, i.e.
Principal orbit type theorem         
In mathematics, the principal orbit type theorem states that compact Lie group acting smoothly on a connected differentiable manifold has a principal orbit type.

Wikipedia

Principal type

In type theory, a type system is said to have the principal type property if, given a term and an environment, there exists a principal type for this term in this environment, i.e. a type such that all other types for this term in this environment are an instance of the principal type.

The principal type property is a desirable one for a type system, as it provides a way to type expressions in a given environment with a type which encompasses all of the expressions' possible types, instead of having several incomparable possible types. Type inference for systems with the principal type property will usually attempt to infer the principal type.

For instance, the ML system has the principal type property and principal types for an expression can be computed by Robinson's unification algorithm, which is used by the Hindley–Milner type inference algorithm. However, many extensions to the type system of ML, such as polymorphic recursion, can make the inference of the principal type undecidable. Other extensions, such as Haskell's generalized algebraic data types, destroy the principal type property of the language, requiring the use of type annotations or the compiler to "guess" the intended type from among several options.

The principal typing property requires that, given a term, there exist a typing (i.e. a pair with a context and a type) which is an instance of all possible typings of the term. The principal typing property can be confused with the principle type property but is distinct. The principle type property relies on the context as an input to determine the type, but the principle typing property outputs the context as a result.